﻿$(function () {

    $("#mycarousel").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev"
    });

});

function logoAnimation() {
    $("article.logo.nurturehood").stop().delay(100).find('img').animate({ 'width': "105px" }, 1000).closest('article').delay(500).animate({ 'marginLeft': "805px" }, 8000);

    var addMargin = false;
    setInterval(function() {
        headerTextAnimation(addMargin);
        addMargin = true;
    }, 5000);
}

function headerTextAnimation(addMargin) {
    if (addMargin != undefined && addMargin == true) {
        $("#div-to-animate-upper").css('left', '430px');
        $("#div-to-animate-lower").css('left', '470px');
    }

    var upperLine = 'nurturehood';
    var lowerLine = "As precious as a Mother's Care";
    
    var textFxSettingsUpper = { animation: 8, color: "#0975B8", animationType: "in", speed: 2500, easing: "easeInOutBounce", sequenceDelay: 50, offsetX: 100, offsetY: 50 };

    jQuery.cjTextFx(textFxSettingsUpper); // INIT FUNCTION
    $("#div-to-animate-upper").html(upperLine);
    jQuery.cjTextFx.animate("#div-to-animate-upper");

    var textFxSettingsLower = { animation: 4, color: "#7DC94B", animationType: "in", speed: 2500, easing: "easeInOutBounce", sequenceDelay: 50, offsetX: 100, offsetY: 50 };

    jQuery.cjTextFx(textFxSettingsLower); // INIT FUNCTION
    $("#div-to-animate-lower").html(lowerLine);
    jQuery.cjTextFx.animate("#div-to-animate-lower");
}